package com.LHD.controller;

import com.LHD.entity.Student;
import com.LHD.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/student")
public class StudentController {

	@Autowired
	private StudentService studentService;

	@GetMapping("/list")
	@ResponseBody
	public List<Student> list(){
		List<Student> students = studentService.findAll();
		System.out.println("1111111111111111111111111");
		System.out.println("StudentController.list");
		System.out.println(students);
		return studentService.findAll();
	}
}
